package org.databasefacade.xml.schema.tags;


import org.databasefacade.registry.TableRegistry;
import org.databasefacade.util.XMLDataRecord;
import org.databasefacade.util.XMLParseUtil;
import org.databasefacade.xml.schema.XMLSchemaConst;


public class TableTagAssign implements XMLSchemaConst
{
	static XMLParseUtil xmlutil = new XMLParseUtil();
	
	public static void assign(TableRegistry registry, XMLDataRecord table)
	{
		String tableName = table.getAttributeValue(TAG_TABLE_ATTR_NAME);
		if ( tableName == null ) {
			throw new RuntimeException(
				"The <" + TAG_TABLE + "> element must have a '" + TAG_TABLE_ATTR_NAME
				+ "' attribute");
		}
		String tableDDLMode = table.getAttributeValue(TAG_TABLE_ATTR_DDL_MODE);
		System.out.println(tableName);
		System.out.println(tableDDLMode);
		ColumnsTagAssign.assign(registry, table);
		ConstraintsTagAssign.assign(registry, table);
		IndexesTagAssign.assign(registry, table);
		RelationsTagAssign.assign(registry, table);
		RenderingTagAssign.assign(registry, table);
		ReportingTagAssign.assign(registry, table);
		TriggersTagAssign.assign(registry, table);
	}
}
